Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Draw Region Validation

The state of all draw regions attached to a draw context are validated by the draw context and draw region internal code before a frame is rendered. However, renderers may wish to modify their own state--for example, to alter cached information. To support such modifications, QuickDraw 3D supplies renderers with information about what has changed in the draw region via the Q3XDrawContext_GetValidationFlags routine.

The following mask values let you determine which draw region states have changed since the last frame. Call the Q3XDrawContext_ClearValidationFlags routine afterward to clear the flag information.

typedef enum TQ3XDrawContextValidationMasks {
    kQ3XDrawContextValidationClearFlags             = 0x00000000L,
    kQ3XDrawContextValidationDoubleBuffer           = 1 << 0,
    kQ3XDrawContextValidationShader                 = 1 << 1,
    kQ3XDrawContextValidationClearFunction          = 1 << 2,
    kQ3XDrawContextValidationActiveBuffer           = 1 << 3,
    kQ3XDrawContextValidationInternalOffScreen      = 1 << 4,
    kQ3XDrawContextValidationPane                   = 1 << 5,
    kQ3XDrawContextValidationMask                   = 1 << 6,
    kQ3XDrawContextValidationDevice                 = 1 << 7,
    kQ3XDrawContextValidationWindow                 = 1 << 8,
    kQ3XDrawContextValidationWindowSize             = 1 << 9,
    kQ3XDrawContextValidationWindowClip             = 1 << 10,
    kQ3XDrawContextValidationWindowPosition         = 1 << 11,
    kQ3XDrawContextValidationPlatformAttributes     = 1 << 12,
    kQ3XDrawContextValidationForegroundShader       = 1 << 13,
    kQ3XDrawContextValidationBackgroundShader       = 1 << 14,
    kQ3XDrawContextValidationColorPalette           = 1 << 15,
    kQ3XDrawContextValidationAll                    = ~0
} TQ3XDrawContextValidationMasks;
typedef unsigned long       TQ3XDrawContextValidation;

Q3XDrawContext_GetValidationFlags

The Q3XDrawContext_GetValidationFlags function lets you determine which draw context states have changed since the last frame.

typedef unsigned long TQ3XDrawContextValidation;
TQ3Status Q3XDrawContext_GetValidationFlags(
                     TQ3DrawContextObject         drawContext,
                     TQ3XDrawContextValidation    *validationFlags);
drawContext
A draw context.
validationFlags
Validation flags from the TQ3XDrawContextValidationMasks enumeration.

DESCRIPTION

The Q3XDrawContext_GetValidationFlags function returns, in the validationFlags parameter, flags indicating which states of the drawContext draw context have changed since the last frame.

Q3XDrawContext_ClearValidationFlags

Once your renderer has updated the current draw context state, it should call the Q3XDrawContext_ClearValidationFlags routine to clear the validation flags. Otherwise flags may remain set during the next frame when the state has not changed.

TQ3Status Q3XDrawContext_ClearValidationFlags(
                     TQ3DrawContextObject    drawContext);
drawContext
A draw context.

DESCRIPTION

The Q3XDrawContext_ClearValidationFlags function clears all the validation flags returned by Q3XDrawContext_GetValidationFlags.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |